#define SDCARD_MEM_START_ADDR   (0x9b000000)
#define SDCARD_BLOCK_SIZE   512

#if 0
unsigned char sd_read_sector(unsigned int *buf, unsigned int addr, unsigned int block_num)
{
    int data_size = block_num * SDCARD_BLOCK_SIZE / 4;
    int data_start = SDCARD_MEM_START_ADDR + addr * SDCARD_BLOCK_SIZE / 4;
    int i;
    unsigned int *p_data_start = (unsigned int *)data_start;

    for (i = 0; i < data_size; i++) {
        // printf("## sd_read_sector(): data is 0x%x\n", *p_data_start);
        *buf++ = *p_data_start++;
    }

    return 0;
}

unsigned char sd_write_sector(unsigned int *buf, unsigned int addr, unsigned int block_num)
{
    int data_size = block_num * SDCARD_BLOCK_SIZE / 4;
    int data_start = SDCARD_MEM_START_ADDR + addr * SDCARD_BLOCK_SIZE / 4;
    int i;
    unsigned int *p_data_start = (unsigned int *)data_start;

    for (i = 0; i < data_size; i++) {
        // printf("## sd_write_sector(): data is 0x%x\n", *buf);
        *p_data_start++ = *buf++;
    }

    return 0;
}
#endif
